package com.ying.user.controller;

import com.ying.common.entity.Response;
import com.ying.user.entity.MmRole;
import com.ying.user.service.MmRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.function.Function;

@RestController
@RequestMapping(value = "/mmRole")
public class MmRoleController {

    @Autowired
    private MmRoleService mmRoleService;

    @PostMapping(value = "/add")
    public Response add(@RequestBody MmRole mmRole) {
        Function<MmRole, Response> add = mmRoleService.add();
        return add.apply(mmRole);
    }

}
